﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UserProfile.cs" company="Anton Frattaroli">
//   Copyright (c) Anton Frattaroli. All rights reserved.
// </copyright>
// <summary>
//   Defines the UserProfile class business object.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Lidocaine.BusinessObjects
{
    /// <summary>
    /// The UserProfile class.
    /// </summary>
    public class UserProfile
    {
        /// <summary>
        /// Stores the UserProfile password.
        /// </summary>
        private byte[] password;

        /// <summary>
        /// Gets or sets the database identity field for this user entry.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the user's username.
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// Gets a value indicating whether or not this user is anonymous.
        /// </summary>
        public bool IsAnonymous
        {
            get
            {
                return this.Id == 0 ? true : false;
            }
        }

        /// <summary>
        /// Gets the Profile password.
        /// </summary>
        /// <returns>A password hash.</returns>
        public byte[] GetPassword()
        {
            return this.password;
        }

        /// <summary>
        /// Sets the Profile password.
        /// </summary>
        /// <param name="value">The password value to set.</param>
        public void SetPassword(byte[] value)
        {
            this.password = value;
        }
    }
}